<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
//dpm($data);
?>
<table style="font-size: 12px">
    <tr><th>Seller</th><th>Campaign</th><th>Date</th><th>Team</th><th>Team Goal</th><th>Seller Achievement</th></tr>

    <?php foreach ($data as $key => $value) : ?>
    <?php if($options['show_zero_sale']==1||$value[amount_money]!= 0): ?>
        <tr class="orderRow">
            <td><?php echo $value['name']; ?></td>
            <td><a href="javascript:void(0);" id="campaign_<?php echo $key;?>"><?php echo $value['campaign_title']; ?></a></td>
            <?php 
                $start = explode('T', $value['start_time']);
                $end = explode('T', $value['end_time']);
            ?>
            <td><?php echo $start[0].'--'.$end[0]; ?></td>
            <td><?php echo $value['team']['title']; ?></td>
            <td><?php echo '$'.$value['team']['goal']; ?></td>
            <td><?php echo '$'.$value['amount_money']; ?></td>
        </tr>
        <?php if(isset($value['product_list'])) :?>
            <?php foreach ($value['product_list'] as $item) : ?>
                <tr class="productList campaign_<?php echo $key;?>">
                    <td></td>
                    <td></td>
                    <td><?php echo $item->title; ?></td>
                    <td><?php echo '$'.($item->cost + $item->price); ?></td>
                    <td><?php echo $item->qty; ?></td>
                    <td><?php echo '$'.($item->cost + $item->price)*$item->qty; ?></td>
                </tr>
            <?php endforeach; ?>
        <?php endif;?>
    <?php endif;?>
    <?php endforeach; ?>
</table>

<?php echo $pager; ?>

